package com.zff.web.service.impl;

import java.util.Date;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.zff.web.dao.UserMapper;
import com.zff.web.po.UserPo;
import com.zff.web.service.UserService;

@Service
public class UserServiceImpl implements UserService{
	
	private static final Log LOG = LogFactory.getLog(UserServiceImpl.class);

    @Autowired
    private UserMapper userMapper;

	@Override
	public UserPo userLogin(UserPo userpo) {
		LOG.info("�û�����"+userpo.getUserName());
		LOG.info("���룺"+userpo.getUserPassword());
		UserPo userLogin = userMapper.userLogin(userpo);
		return userLogin;
	}

	@Override
	public int userRegister(UserPo userpo) {
		UserPo newUserPo = new UserPo();
		newUserPo.setUserName(userpo.getUserName());
		newUserPo.setUserPassword(userpo.getUserPassword());
		newUserPo.setCreateBy(1L);
		newUserPo.setCreateDate(new Date());
		newUserPo.setMarkForDelete(false);
		return userMapper.insert(newUserPo);
	}

    
}
